<?php
	
	$C	= new stdClass;
	$C->INCPATH		= dirname(__FILE__).'/';
	
	if( ! file_exists($C->INCPATH.'conf_main.php') ) {
		exit;
	}
	require_once($C->INCPATH.'conf_main.php');
	
	chdir( $C->INCPATH );
	
	$C->DEBUG_MODE		= in_array($_SERVER['REMOTE_ADDR'], $C->DEBUG_USERS);
	if( $C->DEBUG_MODE ) {
		ini_set( 'error_reporting', E_ALL | E_STRICT	);
		ini_set( 'display_errors',			1	);
	}
	
	$C->IMG_URL		= $C->SITE_URL.'i/';
	$C->IMG_DIR		= $C->INCPATH.'../i/';
	$C->TMP_URL		= $C->IMG_URL.'tmp/';
	$C->TMP_DIR		= $C->IMG_DIR.'tmp/';
			$C->UC_DIR		= $C->INCPATH.'../uc_client/';
	$C->UC_URL		= $C->SITE_URL.'uc_client/';
	$C->API_ID		= 0;
	
	$C->DEF_AVATAR_USER	= '_noavatar_user.gif';
	$C->DEF_AVATAR_GROUP	= '_noavatar_group.gif';
	
	$C->AVATAR_SIZE	= 200;
	$C->AVATAR_SIZE1	= 50;
	$C->AVATAR_SIZE2	= 16;
	$C->AVATAR_SIZE3	= 30;
	
	$C->POST_MAX_SYMBOLS	= 160;
	
	$C->PAGING_NUM_USERS	= 24;
	$C->PAGING_NUM_POSTS	= 10;
	$C->PAGING_NUM_GROUPS	= 24;
	$C->PAGING_NUM_COMMENTS	= 5;
	$C->POST_LAST_COMMENTS	= 3;
	
	if( substr($_SERVER['HTTP_HOST'], 0, 2) == 'm.' ) {
		$C->API_ID		= 1;
	}
	elseif( $_SERVER['REQUEST_URI']=='/m' || substr($_SERVER['REQUEST_URI'], 0, 3)=='/m/' ) {
		$C->API_ID		= 1;
	}
	if( $C->API_ID == 1 ) {
		$C->PAGING_NUM_USERS	= 10;
		$C->PAGING_NUM_POSTS	= 5;
		$C->PAGING_NUM_GROUPS	= 10;
		$C->PAGING_NUM_COMMENTS	= 5;
	}
	
	$C->ATTACH_VIDEO_NOTHUMB	= '_nothumb_video.gif';
	$C->ATTACH_VIDEO_THUMBSIZE	= 60;
	$C->ATTACH_IMAGE_THUMBSIZE	= 60;
	$C->ATTACH_IMAGE_MXWIDTH	= 600;
	$C->ATTACH_IMAGE_MXHEIGHT	= 500;
	
	$C->POST_ICONS	= array (
		':)'	=> 'icon_smile.gif',
		':('	=> 'icon_sad.gif',
		';)'	=> 'icon_wink.gif',
		':P'	=> 'icon_razz.gif',
		':Р'	=> 'icon_razz.gif',
		':D'	=> 'icon_biggrin.gif',
		';('	=> 'icon_cry.gif',
			'[face14.gif]'	=> '01.gif',
'[face1.gif]'	=> '02.gif',
'[face2.gif]'	=> '03.gif',
'[face3.gif]'	=> '04.gif',
'[face4.gif]'	=> '05.gif',
'[face5.gif]'	=> '06.gif',
'[face6.gif]'	=> '07.gif',
'[face7.gif]'	=> '08.gif',
'[face8.gif]'	=> '09.gif',
'[face9.gif]'	=> '10.gif',
'[face10.gif]'	=> '11.gif',
'[face11.gif]'	=> '12.gif',
'[face12.gif]'	=> '13.gif',
'[face13.gif]'	=> '14.gif',
'[face0.gif]'	=> '15.gif',
'[face15.gif]'	=> '16.gif',
'[face16.gif]'	=> '17.gif',
'[face96.gif]'	=> '18.gif',
'[face18.gif]'	=> '19.gif',
'[face19.gif]'	=> '20.gif',
'[face20.gif]'	=> '21.gif',
'[face21.gif]'	=> '22.gif',
'[face22.gif]'	=> '23.gif',
'[face23.gif]'	=> '24.gif',
'[face24.gif]'	=> '25.gif',
'[face25.gif]'	=> '26.gif',
'[face26.gif]'	=> '27.gif',
'[face27.gif]'	=> '28.gif',
'[face28.gif]'	=> '29.gif',
'[face29.gif]'	=> '30.gif',
'[face30.gif]'	=> '31.gif',
'[face31.gif]'	=> '32.gif',
'[face32.gif]'	=> '33.gif',
'[face33.gif]'	=> '34.gif',
'[face34.gif]'	=> '35.gif',
'[face35.gif]'	=> '36.gif',
'[face36.gif]'	=> '37.gif',
'[face37.gif]'	=> '38.gif',
'[face38.gif]'	=> '39.gif',
'[face39.gif]'	=> '40.gif',
'[face97.gif]'	=> '41.gif',
'[face98.gif]'	=> '42.gif',
'[face99.gif]'	=> '43.gif',
'[face100.gif]'	=> '44.gif',
'[face101.gif]'	=> '45.gif',
'[face102.gif]'	=> '46.gif',
'[face103.gif]'	=> '47.gif',
'[face104.gif]'	=> '48.gif',
'[face105.gif]'	=> '49.gif',
'[face106.gif]'	=> '50.gif',
'[face107.gif]'	=> '51.gif',
'[face108.gif]'	=> '52.gif',
'[face109.gif]'	=> '53.gif',
'[face110.gif]'	=> '54.gif',
'[face111.gif]'	=> '55.gif',
'[face112.gif]'	=> '56.gif',
'[face89.gif]'	=> '57.gif',
'[face113.gif]'	=> '58.gif',
'[face114.gif]'	=> '59.gif',
'[face115.gif]'	=> '60.gif',
'[face60.gif]'	=> '61.gif',
'[face61.gif]'	=> '62.gif',
'[face46.gif]'	=> '63.gif',
'[face63.gif]'	=> '64.gif',
'[face64.gif]'	=> '65.gif',
'[face116.gif]'	=> '66.gif',
'[face66.gif]'	=> '67.gif',
'[face67.gif]'	=> '68.gif',
'[face53.gif]'	=> '69.gif',
'[face54.gif]'	=> '70.gif',
'[face55.gif]'	=> '71.gif',
'[face56.gif]'	=> '72.gif',
'[face57.gif]'	=> '73.gif',
'[face117.gif]'	=> '74.gif',
'[face59.gif]'	=> '75.gif',
'[face75.gif]'	=> '76.gif',
'[face74.gif]'	=> '77.gif',
'[face69.gif]'	=> '78.gif',
'[face49.gif]'	=> '79.gif',
'[face76.gif]'	=> '80.gif',
'[face77.gif]'	=> '81.gif',
'[face78.gif]'	=> '82.gif',
'[face79.gif]'	=> '83.gif',
'[face118.gif]'	=> '84.gif',
'[face119.gif]'	=> '85.gif',
'[face120.gif]'	=> '86.gif',
'[face121.gif]'	=> '87.gif',
'[face122.gif]'	=> '88.gif',
'[face123.gif]'	=> '89.gif',
'[face124.gif]'	=> '90.gif',
'[face42.gif]'	=> '91.gif',
'[face85.gif]'	=> '92.gif',
'[face43.gif]'	=> '93.gif',
'[face41.gif]'	=> '94.gif',
'[face86.gif]'	=> '95.gif',
'[face125.gif]'	=> '96.gif',
'[face126.gif]'	=> '97.gif',
'[face127.gif]'	=> '98.gif',
'[face128.gif]'	=> '99.gif',
'[face129.gif]'	=> '100.gif',
'[face130.gif]'	=> '101.gif',
'[face121.gif]'	=> '102.gif',
'[face132.gif]'	=> '103.gif',
'[face133.gif]'	=> '104.gif',
'[face134.gif]'	=> '105.gif',
	);
	
	$C->THEME	= 'default';
	$C->DEF_SITE_URL		= $C->SITE_URL;
	$C->OUTSIDE_DOMAIN	= $C->DOMAIN;
	$C->OUTSIDE_SITE_URL	= $C->SITE_URL;
	$C->SITE_TITLE		= '';
	$C->OUTSIDE_SITE_TITLE	= '';
	$C->DEF_LANGUAGE	= $C->LANGUAGE;
	
	ini_set( 'magic_quotes_runtime',		0	);
	ini_set( 'session.name',			my_session_name($C->DOMAIN)	);
	ini_set( 'session.cache_expire',		300	);
	ini_set( 'session.cookie_lifetime',		0	);
	ini_set( 'session.cookie_path',		'/'	);
	ini_set( 'session.cookie_domain',		cookie_domain()	);
	ini_set( 'session.cookie_httponly',		1	);
	ini_set( 'session.use_only_cookies',	1	);
	ini_set( 'session.gc_maxlifetime',		10800	);
	ini_set( 'session.gc_probability',		1	);
	ini_set( 'session.gc_divisor',		1000	);
	ini_set( 'zlib.output_compression_level',	7	);
	ini_set( 'max_execution_time',		20	);
	
	if( ! function_exists('mb_internal_encoding') ) {
		require_once( $C->INCPATH.'helpers/func_mbstring.php' );
	}
	mb_internal_encoding('UTF-8');
	
	if( ! function_exists('json_encode') ) {
		require_once( $C->INCPATH.'helpers/func_json.php' );
	}
	
?>